<%@ tag body-content="empty" %>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/thickbox.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/thickbox.css" type="text/css"
      media="screen"/>

<link rel="stylesheet" href="${pageContext.request.contextPath}/css/datePicker.css" type="text/css"
      media="screen"/>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/date.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.datePicker.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.form.js"></script>

<script type="text/javascript" charset="utf-8">
    $(function()
    {
        Date.firstDayOfWeek = 7;
        Date.format = 'dd-mm-yyyy';
        $('.date-pick').datePicker();
    });
</script>


<script type="text/javascript"
        src='${pageContext.request.contextPath}/dwr/engine.js'>
</script>

<script type="text/javascript"
        src='${pageContext.request.contextPath}/dwr/util.js'>
</script>

<script type="text/javascript"
        src='${pageContext.request.contextPath}/dwr/interface/FileUploadProgressListener.js'>
</script>
<script type="text/javascript">

    var uploadPropertyName

    function setUploadedPathValue() {

        document.getElementById(uploadPropertyName).value = document.getElementById('uploaded_path_' + uploadPropertyName).value
    }


    function updateStatus() {
        FileUploadProgressListener.getFileUploadStatus(refreshProgress);
    }

    function refreshProgress(progressPercent) {

        // alert(progressPercent)

        document.getElementById('progressBarText_' + uploadPropertyName).innerHTML = 'upload in progress: ' + progressPercent + '%';

        document.getElementById('progressBarBoxContent_' + uploadPropertyName).style.width = parseInt(progressPercent * 3.5) + 'px';
        if (progressPercent < 100)
            window.setTimeout("updateStatus()", 500);


        return true;
    }

    function startProgress()
    {
        document.getElementById('output_upload_' + uploadPropertyName).innerHTML = '<spring:message code="uploadInProgressLabel" text="Upload in progress please wait" htmlEscape="true"/>';

        // alert('Starting Monitoring ' + uploadPropertyName)
        //var progressPercent = FileUploadProgressListener.getFileUploadStatus();
        // alert('perc? '+progressPercent)
        // wait a little while to make sure the upload has started ..

        window.setTimeout("updateStatus()", 500);
        return true;
    }

</script>